<script setup lang="ts">
import type { UploaderAfterRead, UploaderFileListItem } from 'vant/lib/uploader/types'
import { ref } from 'vue'

const afterRead: UploaderAfterRead = res => {
  console.log(res)
}
const fileList = ref<UploaderFileListItem[]>([])
const upRef = ref()
// 1:自己写的  InstanceType<typeof  组件>
// 2：外部的  找相应类型，找不到用any
</script>

<template>
  <h3>{{ fileList }}</h3>
  <van-uploader
    ref="upRef"
    :max-count="2"
    :max-size="5 * 1024 * 1024"
    :after-read="afterRead"
    v-model="fileList"
  />
</template>

<style lang="scss" scoped></style>
